<template>
  <CommonContainer title="客户信息">
    <el-form :model="form" ref="leaseContract" label-width="120px" label-position="right">
      <!-- 租赁合同信息 -->
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="主订单编码:">
            <span @click="orderDetail" style="color: #1890ff; cursor: pointer"> {{ form.mainOrderCode | filterNull }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="子订单编码:">
            <span style="color: #1890ff; cursor: pointer" @click="goOrder">{{ form.orderCarCode | filterNull }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="合同时间:">
            <span>{{ form.contractStartTime | filterNull }} 至 {{ form.contractEndTime | filterNull }} </span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="标准日租金:">
            <span>{{ format_thousand(form.dailyRent) }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="客户名称:" prop="eeeeee">
            <span>{{ form.customerName | filterNull }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="车辆归属:" prop="ascriptionName">
            <span>{{ form.ascriptionName | filterNull }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="业务类型:" prop="businessType">
            <dict-tag :options="dict.type.car_business_type" :value="form.businessType" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </CommonContainer>
</template>
<script>
export default {
  name: 'leaseContract',
  dicts: ['car_business_type'],
  props: {
    value: {
      type: Object,
      default: {},
    },
    state: {
      type: String,
      default: '',
    },
  },
  computed: {
    form: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      },
    },
    type() {
      let status
      switch (this.state) {
        case 'write':
          status = 'edit'
          break
        case 'disabled':
          status = 'detail'
          break
        case 'readonly':
          status = 'detail'
          break
        case 'detail':
          status = 'detail'
          break
        case 'edit':
          status = 'edit'
        case 'add':
          status = 'add'
          break
      }
      return status
    },
  },
  data() {
    return {}
  },
  created() {},
  methods: {
    // 主订单订单详情
    orderDetail() {
      this._toPage({
        path: '/vehicleOrder/orderManagement/OrderDetails',
        name: 'OrderDetails',
        query: {
          type: this.form.carType,
          orderId: this.form.orderId,
          calcSchemeId: this.form.calcSchemeId,
        },
      })
    },
    // 子订单详情
    goOrder() {
      this.$router.push({
        name: 'SuborderDetail',
        query: {
          id: this.form.orderCarId,
          orderId: this.form.mainOrderCode,
        },
      })
    },
  },
}
</script>
<style lang="scss" scoped>
.box-wraps:after {
  content: '';
  display: block;
  clear: both;
  width: 32%;
}
</style>
